export function getStyle(el: HTMLElement, attr: string) {
  const style = getComputedStyle(el);
  return style.getPropertyValue(attr);
}

export function on(
  el: HTMLElement | Document | Window,
  event: string,
  handler: EventListenerOrEventListenerObject,
  capture = false
) {
  if (el && event && handler) {
    el.addEventListener(event, handler, capture);
  }
}
export function off(
  el: HTMLElement | Document | Window,
  event: string,
  handler: EventListenerOrEventListenerObject,
  capture = false
) {
  if (el && event && handler) {
    el.removeEventListener(event, handler, capture);
  }
}
